const router = require('koa-router')()
const areas = require('../models/areas.js')
router.prefix('api/areas');


router.get('/', async (ctx, next) => {
  ctx.body = await areas.getArea();
})

router.post('/', async (ctx, next) => {
  ctx.body = {
    title: 'post area'
  }
})

router.put('/json', async (ctx, next) => {
  ctx.body = {
    title: 'put area'
  }
})


router.delete('/:id', async (ctx, next) => {
  ctx.body = {
    title: 'delete area'
  }
})

module.exports = router
